#pragma once
#include"HashTable.h"

namespace szt
{
	template<class K, class V, class HashFunc = Hash<K>>
	class unordered_map
	{
		struct MapKeyOfT
		{
			const K& operator()(const pair<K,V>& kv)
			{
				return kv.first;
			}
		};
	public:
		typedef typename LinkHash::HashTable<K, pair<K, V>, MapKeyOfT, HashFunc>::iterator iterator;
		iterator begin()
		{
			return mht.begin();
		}

		iterator end()
		{
			return mht.end();
		}

		bool erase(const pair<K, V>& kv)
		{
			return mht.Erase(kv);
		}

		bool insert(const pair<K, V>& kv)
		{
			return mht.Insert(kv);
		}

	private:
		LinkHash::HashTable<K, pair<K, V>, SetKeyOfT, HashFunc> mht;
	};
}
